import 'dart:io';

import 'package:flutter/material.dart';

class UiRemoveOverscrollIndicator extends StatelessWidget {
  const UiRemoveOverscrollIndicator({super.key, required this.child});
  final Widget child;
  @override
  Widget build(BuildContext context) {
    return ScrollConfiguration(
      behavior: UiRemoveOverscrollIndicatorBehavior(),
      child: child,
    );
  }
}

class UiRemoveOverscrollIndicatorBehavior extends ScrollBehavior {
  @override
  Widget buildOverscrollIndicator(context, child, details) {
    if (Platform.isAndroid || Platform.isFuchsia) return child;
    return super.buildOverscrollIndicator(context, child, details);
  }
}
